import { createApp } from 'vue'
import App from './App.vue'
// 引入svg
import SvgIcon from './components/SvgIcon/index.vue'
// 导入Unocss
import 'uno.css'
//引入信息提示
import 'element-plus/theme-chalk/el-message.css'
//! 获取模块
// const files = import.meta.globEager('../build/config/*.ts')
// console.log(files)
//引入pinia
import { createPinia } from 'pinia'
//引入vue-router
import router, { setupRouter } from './router' // 路由
//导入权限控制
import './permission'
//导入全局组件
import myPlugin from '@/components/index'
const app = createApp(App)
//全局挂载组件
import * as directives from '@/directives'
Object.keys(directives).forEach((key) => app.directive(key,directives[key as keyof typeof directives]))

//引入语言包
import lang from './lang'


app.use(lang)
app.use(myPlugin)
//全局挂载svg
app.component('SvgIcon', SvgIcon)
//挂载pinia
app.use(createPinia())
//挂载路由
setupRouter(app) // 引入路由
//绑定app容器
router.isReady().then(() =>app.mount('#app') )

